AnnieRoot.gcow=AnnieRoot.gcow||{};
gcow.MobileCow=function(){
	var s = this;
	annie.MovieClip.call(s);
	/*_a2x_need_start*/s.cowHitTestArea=null;/*_a2x_need_end*/
	annie.initRes(s,"gcow","MobileCow");
	s.name = 'cow';
	//your code here
	s.addEventListener(annie.Event.ADD_TO_STAGE, s.addToStage.bind(s));
};
A2xExtend(gcow.MobileCow,annie.MovieClip);
gcow.MobileCow.prototype.status = 0;//0正常状态，1套中状态
gcow.MobileCow.prototype.type = 3;//
gcow.MobileCow.prototype.speed = 24;//手机牛初始速度
//进入场景
gcow.MobileCow.prototype.addToStage = function (e) {
	var s = this;
	s.startMoving();
};
gcow.MobileCow.prototype.startMoving = function (e) {
	var s = this;
	s.addEventListener(annie.Event.ENTER_FRAME, s.bmh = s.cowMovingHandler.bind(s));
};
gcow.MobileCow.prototype.stopMoving = function (e) {
	var s = this;
	s.removeEventListener(annie.Event.ENTER_FRAME, s.bmh);
};
/**
 * 牛牛移动
 * @param e
 */
gcow.MobileCow.prototype.cowMovingHandler = function (e) {
	var s = this;
	s.x -= s.speed;
	if (s.x < -360) {
		s.removeEventListener(annie.Event.ENTER_FRAME, s.bmh);
		s.bmh = null;
		annie.globalDispatcher.dispatchEvent('recoveryCowEvent', s);//抛出回收牛牛事件，回收视窗以外的牛牛到牛牛池中
		s.parent.removeChild(s);//把视窗外的牛牛移除舞台
	}
};
